'''
Created on 2010-10-4

@author: lijun
'''

import datetime
import time


from dateTools import DateTime2Str
from kspiderapp.dbUtil import InsertMultiDB
from kspiderapp import conf



def InsertDB():
    date = datetime.datetime.now()
    
    users = ['kitty','aa','bb','cc','dd','ee','ff']
    action = 'del'
    code = 'OK'
    info = ''
    count = 0
    count2 = 0
    fileSize = 1000
    fileCount = 435
    
    for i in range(1000):
        dateStr = DateTime2Str(date)
        for user in users:
            count += InsertMultiDB(table=conf.ACTIONINFO_TABLE, 
                      fields=['date_time','user','action','code','info'],
                      values=[[dateStr, user, action, code, info],])
            
            count2 += InsertMultiDB(table=conf.FILEINFO_TABLE,
                                    fields=['date_time', 'user', 'file_size', 'file_count'],
                                    values=[[dateStr, user, fileSize, fileCount], ])
        date = date - datetime.timedelta(minutes=30)
        fileSize += 1897
        fileCount += 223
        
    print count,count2
    
    
    
if __name__ == '__main__':
    InsertDB()
    
    
    
    
    
    
    
    
    
    
    
    